#include<stdio.h>
int main()
{
	int a[100] = { 0 };
	int i = 0;
	while (i<100)
	{
		scanf_s("%d", &a[i]);
		if (a[i] == -1)
			break;
		i++;
	}
	printf("%d\n", i);
	for (int j = 0;j <= i;j++)
	{
		printf("%d", a[j]);
	}
	return 0;
}